﻿using System;
using System.Windows.Forms;

using Strategia;

namespace Strategia.Input
{
    struct sizer
    {
        public float h, w, l;
    };

    public class InputWin : Form
    {
        private TextBox RoomTemp;
        private TextBox WindTemp;
        private TextBox HeatTemp;

        private Label label3;
        private Label label4;
        private Label label6;
        private Button Go;
        private TextBox SimulationTime;
        private Label label7;
        private GroupBox groupWind;
        private GroupBox groupHeat;
        private GroupBox groupRoom;
        private TextBox text;
        
        public InputWin()
        {
            this.Text = Application.StartupPath;

            InitializeComponent();
        }

        private void InitializeComponent()
        {
            this.label3 = new System.Windows.Forms.Label();
            this.label4 = new System.Windows.Forms.Label();
            this.label6 = new System.Windows.Forms.Label();
            this.Go = new System.Windows.Forms.Button();
            this.RoomTemp = new System.Windows.Forms.TextBox();
            this.HeatTemp = new System.Windows.Forms.TextBox();
            this.SimulationTime = new System.Windows.Forms.TextBox();
            this.label7 = new System.Windows.Forms.Label();
            this.WindTemp = new System.Windows.Forms.TextBox();
            this.groupWind = new System.Windows.Forms.GroupBox();
            this.groupHeat = new System.Windows.Forms.GroupBox();
            this.groupRoom = new System.Windows.Forms.GroupBox();
            this.groupWind.SuspendLayout();
            this.groupHeat.SuspendLayout();
            this.groupRoom.SuspendLayout();
            this.SuspendLayout();
            // 
            // label3
            // 
            this.label3.AutoSize = true;
            this.label3.Location = new System.Drawing.Point(66, 22);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(227, 13);
            this.label3.TabIndex = 4;
            this.label3.Text = "Temperatura początkowa w pomieszczeniu [K]";
            // 
            // label4
            // 
            this.label4.AutoSize = true;
            this.label4.Location = new System.Drawing.Point(67, 22);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(128, 13);
            this.label4.TabIndex = 4;
            this.label4.Text = "Temperatura grzejnika [K]";
            // 
            // label6
            // 
            this.label6.AutoSize = true;
            this.label6.Location = new System.Drawing.Point(79, 171);
            this.label6.Name = "label6";
            this.label6.Size = new System.Drawing.Size(89, 13);
            this.label6.TabIndex = 4;
            this.label6.Text = "Czas symulacji [s]";
            // 
            // Go
            // 
            this.Go.Location = new System.Drawing.Point(276, 168);
            this.Go.Name = "Go";
            this.Go.Size = new System.Drawing.Size(107, 20);
            this.Go.TabIndex = 5;
            this.Go.Text = "Uruchom";
            this.Go.UseVisualStyleBackColor = true;
            this.Go.Click += new System.EventHandler(this.Go_Click);
            // 
            // RoomTemp
            // 
            this.RoomTemp.Location = new System.Drawing.Point(6, 19);
            this.RoomTemp.Name = "RoomTemp";
            this.RoomTemp.Size = new System.Drawing.Size(54, 20);
            this.RoomTemp.TabIndex = 1;
            this.RoomTemp.Text = "20";
            // 
            // HeatTemp
            // 
            this.HeatTemp.Location = new System.Drawing.Point(6, 19);
            this.HeatTemp.Name = "HeatTemp";
            this.HeatTemp.Size = new System.Drawing.Size(54, 20);
            this.HeatTemp.TabIndex = 1;
            this.HeatTemp.Text = "30";
            // 
            // SimulationTime
            // 
            this.SimulationTime.Location = new System.Drawing.Point(18, 168);
            this.SimulationTime.Name = "SimulationTime";
            this.SimulationTime.Size = new System.Drawing.Size(55, 20);
            this.SimulationTime.TabIndex = 1;
            this.SimulationTime.Text = "30";
            // 
            // label7
            // 
            this.label7.AutoSize = true;
            this.label7.Location = new System.Drawing.Point(67, 22);
            this.label7.Name = "label7";
            this.label7.Size = new System.Drawing.Size(140, 13);
            this.label7.TabIndex = 4;
            this.label7.Text = "Temperatura zewnętrzna [K]";
            // 
            // WindTemp
            // 
            this.WindTemp.Location = new System.Drawing.Point(6, 19);
            this.WindTemp.Name = "WindTemp";
            this.WindTemp.Size = new System.Drawing.Size(54, 20);
            this.WindTemp.TabIndex = 1;
            this.WindTemp.Text = "5";
            // 
            // groupWind
            // 
            this.groupWind.Controls.Add(this.label7);
            this.groupWind.Controls.Add(this.WindTemp);
            this.groupWind.Location = new System.Drawing.Point(12, 64);
            this.groupWind.Name = "groupWind";
            this.groupWind.Size = new System.Drawing.Size(371, 46);
            this.groupWind.TabIndex = 14;
            this.groupWind.TabStop = false;
            this.groupWind.Text = "Okno";
            // 
            // groupHeat
            // 
            this.groupHeat.Controls.Add(this.label4);
            this.groupHeat.Controls.Add(this.HeatTemp);
            this.groupHeat.Location = new System.Drawing.Point(12, 116);
            this.groupHeat.Name = "groupHeat";
            this.groupHeat.Size = new System.Drawing.Size(371, 46);
            this.groupHeat.TabIndex = 15;
            this.groupHeat.TabStop = false;
            this.groupHeat.Text = "Grzejnik";
            // 
            // groupRoom
            // 
            this.groupRoom.Controls.Add(this.RoomTemp);
            this.groupRoom.Controls.Add(this.label3);
            this.groupRoom.Location = new System.Drawing.Point(12, 12);
            this.groupRoom.Name = "groupRoom";
            this.groupRoom.Size = new System.Drawing.Size(371, 46);
            this.groupRoom.TabIndex = 16;
            this.groupRoom.TabStop = false;
            this.groupRoom.Text = "Pomieszczenie";
            // 
            // InputWin
            // 
            this.ClientSize = new System.Drawing.Size(397, 200);
            this.Controls.Add(this.groupRoom);
            this.Controls.Add(this.groupHeat);
            this.Controls.Add(this.groupWind);
            this.Controls.Add(this.Go);
            this.Controls.Add(this.label6);
            this.Controls.Add(this.SimulationTime);
            this.Name = "InputWin";
            this.Load += new System.EventHandler(this.MyForm_Load);
            this.groupWind.ResumeLayout(false);
            this.groupWind.PerformLayout();
            this.groupHeat.ResumeLayout(false);
            this.groupHeat.PerformLayout();
            this.groupRoom.ResumeLayout(false);
            this.groupRoom.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        private void MyForm_Load(object sender, EventArgs e)
        {
        }

        private void Go_Click(object sender, EventArgs e)
        {
            Program.initRoomT = (float)Convert.ToDouble(RoomTemp.Text);
            Program.initWindT = (float)Convert.ToDouble(WindTemp.Text);
            Program.initHeatT = (float)Convert.ToDouble(HeatTemp.Text);

            Program.timeOfSimulation = (int)Convert.ToInt32(SimulationTime.Text);
            
            Program.run = true;

            this.Close();
        }

        private void WindPosition_CheckedChanged(object sender, EventArgs e)
        {

        }

    }
}
